jQuery(document).ready(function(){
    jQuery("#help_id").on("click", function(event) {
        event.preventDefault();
        //alert("Get into validation_help")
        if (document.cookie == null || document.cookie == "" | document.cookie == undefined)
            {
            //alert("Cookie is null you will go to login page");
            window.location.href="/login";
            }
        else
            {
            jQuery.ajax({
                scriptCharset: 'utf-8',
                type: "POST",
                url: "/help",
                contentType: "application/json",
                data: JSON.stringify({
                    "uid": document.cookie.split(';')[0].split('=')[1],
                    "phonenumber": document.cookie.split(';')[1].split('=')[1]
                }),
                dataType: "html",
                success: function(result) {
                    //alert("Validation Success");
                    window.location.href="/help";
                },
                error: function(error) {
                    //alert("Validation_help Erro");
                    window.location.href="/login";
                }
            });
        }
    });
});
